//
//  WZCollectionViewCell.m
//  WZEfengAndEtong
//
//  Created by Hongpeng Yu on 2016/10/26.
//  Copyright © 2016年 wanzhao. All rights reserved.
//

#import "WZCollectionViewCell.h"


#define imageSize (HARDWARE_SCREEN_WIDTH - 40) / 3

@implementation WZCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
    
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor lightGrayColor];
//        [self setUpUI];
    }
    return self;
}

- (void)layoutSubviews{
    [super layoutSubviews];
}

- (void)setUpUI {
    UIImageView *imageView = [[UIImageView alloc] init];
    self.imageView = imageView;
    [self.contentView addSubview:imageView];
    imageView.userInteractionEnabled = YES;
    imageView.contentMode = UIViewContentModeScaleAspectFit;
    imageView.image = [UIImage imageNamed:@"80-80"];
    
    
    UIButton *cancleBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    self.cancleBtn = cancleBtn;
    [self.contentView addSubview:cancleBtn];
    [cancleBtn setImage:[UIImage imageNamed:@"Faceperception_Delete_photo"] forState:UIControlStateNormal];
    [cancleBtn setHighlighted:NO];
    [cancleBtn setHidden:NO];
    [cancleBtn addTarget:self action:@selector(cancleBtnClick) forControlEvents:UIControlEventTouchUpInside];
    
    
    
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.right.equalTo(self.contentView).insets(UIEdgeInsetsMake(10, 10, 10, 10));
    }];
    
//    [cancleBtn mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.width.height.mas_equalTo(20);
//        make.top.right.equalTo(self.contentView);
//    }];
}


- (void)cancleBtnClick {
    WZLog(@"cancleBtnClick");
}

- (void)logPressGestureRecongnizerAction {
    
}

@end
